Atomic Instrument Sample Description Record
A
sample description record contains a description of an audio sample, including sample rate, loop points, and lowest and highest key to play on. It is defined by the InstSampleDescRec data type.
struct InstSampleDescRec {
OSType dataFormat;
short numChannels;
short sampleSize;
UnsignedFixed sampleRate;
short sampleDataID;
long offset;
long numSamples;
long loopType;
long loopStart;
long loopEnd;
long pitchNormal;
long pitchLow;
long pitchHigh;
};
typedef struct InstSampleDescRec InstSampleDescRec;
-
dataFormat
-
The data format type. This is either 'twos', for signed data, or 'raw ', for unsigned data.
-
numChannels
-
The number of channels of data present in the sample.
-
sampleSize
-
The size of the sample-- 8-bit or 16-bit.
-
sampleRate
-
The rate at which to play the sample in unsigned fixed-point 16.16.
-
sampleDataID
-
The ID number of a sample data atom that contains the sample audio data.
-
offset
-
Set to 0.
-
numSamples
-
The number of data samples in the sound.
-
loopType
-
The type of loop.
Loop Type Constants
-
loopStart
-
Indicates the beginning of the portion of the sample that is looped if the sound is sustained. The position is given in the number of data samples from the start of the sound.
-
loopEnd
-
Indicates the end of the portion of the sample that is looped if the sound is sustained. The position is given in the number of data samples from the start of the sound.
-
pitchNormal
-
The number of the MIDI note produced if the sample is played at the rate specified in sampleRate.
-
pitchLow
-
The lowest pitch at which to play the sample. Use for instruments, such as pianos, that have different samples to use for different pitch ranges.
-
pitchHigh
-
The highest pitch at which to play the sample. Use for instruments, such as pianos, that have different samples to use for different pitch ranges.
© 1999 Apple Computer, Inc.Previous | Chapter Top | Chapter Contents | Next